webpackJsonp([57], {
    HKzs: function (t, e, a) {
        "use strict";
        Object.defineProperty(e, "__esModule", {value: !0});
        var s = a("mvHQ"), n = a.n(s), l = a("Xxa5"), r = a.n(l), c = a("pFYg"), i = a.n(c), o = a("exGp"), u = a.n(o),
            m = a("Dd8w"), _ = a.n(m), d = a("NYxO"), v = {
                data: function () {
                    return {
                        userList: [{}, {title: "分销员", key: "reseller", auth: "reseller_auth"}, {
                            title: "经纪人",
                            key: "coachbroker",
                            auth: "partner_auth"
                        }, {title: "业务员", key: "salesman", auth: "salesman_auth"}, {
                            title: this.$t("action.channelName"),
                            key: "channel",
                            auth: "channel_auth"
                        }],
                        subForm: {clock_cash_type: 0, clock_cash_status: 1, list: [], level_list: [], addclock_balance: []},
                        subFormRules: {
                            clock_cash_status: {
                                required: !0,
                                type: "number",
                                message: "请选择",
                                trigger: "blur"
                            }, clock_cash_type: {required: !0, type: "number", message: "请选择", trigger: "blur"}
                        }
                    }
                }, created: function () {
                    this.getFormInfo()
                }, computed: _()({}, Object(d.e)({
                    routesItem: function (t) {
                        return t.routes
                    }
                })), methods: {
                    getFormInfo: function () {
                        var t = this;
                        return u()(r.a.mark(function e() {
                            var a, s, n, l;
                            return r.a.wrap(function (e) {
                                for (; ;) switch (e.prev = e.next) {
                                    case 0:
                                        return e.next = 2, t.$api.service.addClockInfo();
                                    case 2:
                                        if (a = e.sent, s = a.code, n = a.data, 200 === s) {
                                            e.next = 7;
                                            break
                                        }
                                        return e.abrupt("return");
                                    case 7:
                                        for (l in n.list = 0 === n.list.length ? [{balance: ""}] : n.list, n.level_list = "object" !== i()(n.level_list) || 0 === n.level_list.length ? [{balance: ""}] : n.level_list, n.addclock_balance.map(function (t) {
                                            t.status = 1 === t.status
                                        }), t.subForm) t.subForm[l] = n[l];
                                    case 11:
                                    case"end":
                                        return e.stop()
                                }
                            }, e, t)
                        }))()
                    }, toAddDel: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, e = arguments[1],
                            a = arguments[2];
                        if (1 === t) this.subForm[a].splice(e, 1); else {
                            var s = this.subForm[a][e].balance, n = 0 === e ? "首次" : "第" + (1 * e + 1) + "次",
                                l = "" === s ? "请输入返佣比例" : "请输入0至100的整数";
                            if ("" === s || !/^(?:0|[1-9][0-9]?|100)$/.test(s)) return void this.$message.error(n + "加钟返佣比例：" + l);
                            this.subForm[a].push({balance: ""})
                        }
                    }, submitFormInfo: function () {
                        var t = this;
                        return u()(r.a.mark(function e() {
                            var a, s, l, c, i, o, u, m, _, d, v, p, b, h, f, k;
                            return r.a.wrap(function (e) {
                                for (; ;) switch (e.prev = e.next) {
                                    case 0:
                                        if (a = !0, t.$refs.subForm.validate(function (t) {
                                            t || (a = !1)
                                        }), a) {
                                            e.next = 4;
                                            break
                                        }
                                        return e.abrupt("return");
                                    case 4:
                                        if (s = JSON.parse(n()(t.subForm)), l = /^(?:0|[1-9][0-9]?|100)$/, c = /^(?:0|[1-9][0-9]?|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2}))|100)$/, s.addclock_balance.map(function (t) {
                                            t.status = t.status ? 1 : 0
                                        }), 1 !== s.clock_cash_status) {
                                            e.next = 26;
                                            break
                                        }
                                        i = 1 === s.clock_cash_type ? "level_list" : "list", e.t0 = r.a.keys(s[i]);
                                    case 11:
                                        if ((e.t1 = e.t0()).done) {
                                            e.next = 22;
                                            break
                                        }
                                        if (o = e.t1.value, u = 1 * o + 1, "" !== (m = s[i][o].balance) && l.test(m)) {
                                            e.next = 20;
                                            break
                                        }
                                        return _ = 1 === u ? "首次" : "第" + u + "次", d = "" === m ? "请输入返佣比例" : "请输入0至100的整数", t.$message.error(_ + "加钟返佣比例：" + d), e.abrupt("return");
                                    case 20:
                                        e.next = 11;
                                        break;
                                    case 22:
                                        s[i].map(function (t, e) {
                                            t.times = 1 * e + 1
                                        }), s.list = s[i], e.next = 27;
                                        break;
                                    case 26:
                                        s.list = [];
                                    case 27:
                                        e.t2 = r.a.keys(s.addclock_balance);
                                    case 28:
                                        if ((e.t3 = e.t2()).done) {
                                            e.next = 38;
                                            break
                                        }
                                        if (v = e.t3.value, p = s.addclock_balance[v], b = p.type, "" !== (h = p.balance) && c.test(h) && !(h && 1 * h > 100)) {
                                            e.next = 36;
                                            break
                                        }
                                        return f = "" === h ? "请输入返佣比例" : "请输入正确的返佣比例，取值0至100，支持2位小数", k = t.userList[b].title, t.$message.error("推广人员加钟返佣设置「" + k + "」：" + f), e.abrupt("return");
                                    case 36:
                                        e.next = 28;
                                        break;
                                    case 38:
                                        return delete s.level_list, e.next = 41, t.$api.service.addClockUpdate(s);
                                    case 41:
                                        t.$message.success(t.$t("tips.successSub")), t.getFormInfo();
                                    case 43:
                                    case"end":
                                        return e.stop()
                                }
                            }, e, t)
                        }))()
                    }
                }
            }, p = {
                render: function () {
                    var t = this, e = t.$createElement, a = t._self._c || e;
                    return a("div", {staticClass: "lb-service-set-bell-set"}, [a("top-nav"), t._v(" "), a("div", {staticClass: "page-main"}, [a("el-form", {
                        ref: "subForm",
                        staticClass: "config-form",
                        attrs: {model: t.subForm, rules: t.subFormRules, "label-width": "160px"},
                        nativeOn: {
                            submit: function (t) {
                                t.preventDefault()
                            }
                        }
                    }, [a("lb-classify-title", {attrs: {title: t.$t("action.attendantName") + "加钟返佣设置"}}), t._v(" "), a("el-form-item", {
                        attrs: {
                            label: "是否开启",
                            prop: "clock_cash_status"
                        }
                    }, [a("el-radio-group", {
                        model: {
                            value: t.subForm.clock_cash_status, callback: function (e) {
                                t.$set(t.subForm, "clock_cash_status", e)
                            }, expression: "subForm.clock_cash_status"
                        }
                    }, [a("el-radio", {attrs: {label: 1}}, [t._v(t._s(t.$t("action.ON")))]), t._v(" "), a("el-radio", {attrs: {label: 0}}, [t._v(t._s(t.$t("action.OFF")))])], 1), t._v(" "), a("lb-tool-tips", [t._v("选择开启，将以以下设置的加钟返佣比例为准，否则将以" + t._s(t.$t("action.attendantName")) + "实际等级的加钟基础值为准\n        ")])], 1), t._v(" "), 1 === t.subForm.clock_cash_status ? a("block", [a("el-form-item", {
                        attrs: {
                            label: "加钟提成方式",
                            prop: "clock_cash_type"
                        }
                    }, [a("el-radio-group", {
                        model: {
                            value: t.subForm.clock_cash_type, callback: function (e) {
                                t.$set(t.subForm, "clock_cash_type", e)
                            }, expression: "subForm.clock_cash_type"
                        }
                    }, [a("el-radio", {attrs: {label: 0}}, [t._v("无差别提成")]), t._v(" "), a("el-radio", {attrs: {label: 1}}, [t._v(t._s("根据" + t.$t("action.attendantName") + "等级提成"))])], 1), t._v(" "), a("lb-tool-tips", [t._v("无差别提成：加钟的提成与" + t._s(t.$t("action.attendantName")) + "当前等级提成比例无关，所有的" + t._s(t.$t("action.attendantName")) + "加钟提成比例一致\n            "), a("div", {staticClass: "mt-sm"}, [t._v("\n              例如：设置首次加钟提成比例75%，提成比例为60%的A" + t._s(t.$t("action.attendantName")) + "和提成比例为80%的B" + t._s(t.$t("action.attendantName")) + "加钟提成都是75%\n            ")]), t._v(" "), a("div", {staticClass: "mt-md"}, [t._v("\n              根据" + t._s(t.$t("action.attendantName")) + "等级提成：加钟的提成比例是在" + t._s(t.$t("action.attendantName")) + "当前等级加钟基础值(若当前等级未设置加钟基础值，则加钟基础值默认为提成比例)上去叠加的\n            ")]), t._v(" "), a("div", {staticClass: "mt-sm"}, [t._v("\n              例如：设置首次加钟提成20%，那么提成比例为60%的A" + t._s(t.$t("action.attendantName")) + "加钟提成应为（60+20）%，提成比例为80%的B" + t._s(t.$t("action.attendantName")) + "加钟比例为（80+20）%\n            ")])])], 1), t._v(" "), a("el-form-item", {
                        attrs: {
                            label: "加钟返佣比例",
                            prop: "list"
                        }
                    }, t._l(1 === t.subForm.clock_cash_type ? t.subForm.level_list : t.subForm.list, function (e, s) {
                        return a("div", {
                            key: s,
                            staticClass: "flex-y-center",
                            class: [{"mt-md": 0 !== s}]
                        }, [a("div", {staticStyle: {width: "150px"}}, [t._v("\n              " + t._s(1 * s + 1 == 1 ? "首次" : "第" + (1 * s + 1) + "次") + "加钟返佣比例\n            ")]), t._v(" "), a("el-input", {
                            attrs: {placeholder: "请输入返佣比例"},
                            model: {
                                value: e.balance, callback: function (a) {
                                    t.$set(e, "balance", a)
                                }, expression: "item.balance"
                            }
                        }, [a("template", {slot: "append"}, [t._v("%")])], 2), t._v(" "), 0 === s ? a("lb-tool-tips", [t._v("若用户实际下单次数超过了后台设置的次数返佣比例，则超出的订单以最后一次设置的比例为准\n              "), 0 === t.subForm.clock_cash_type ? a("block", [a("div", {staticClass: "mt-md"}, [t._v("\n                  例如：后台设置了首次加钟返佣75%，第二次加钟返佣比例80%，但是未设置第三次加钟的返佣比例\n                ")]), t._v(" "), a("div", {staticClass: "mt-sm"}, [t._v("\n                  若用户已加钟2次，第三次加钟的返佣比例应按照80%返给" + t._s(t.$t("action.attendantName")) + "\n                ")])]) : t._e(), t._v(" "), 1 === t.subForm.clock_cash_type ? a("block", [a("div", {staticClass: "mt-md"}, [t._v("\n                  例如：后台设置了首次加钟返佣20%，第二次加钟返佣比例25%，但是未设置第三次加钟的返佣比例\n                ")]), t._v(" "), a("div", {staticClass: "mt-sm"}, [t._v("\n                  若用户已加钟2次，第三次加钟的返佣比例应按照(" + t._s(t.$t("action.attendantName")) + "当前等级提成比例 + 25%)返给" + t._s(t.$t("action.attendantName")) + "，若超过100%，则按100%提成\n                ")])]) : t._e()], 1) : t._e(), t._v(" "), 0 !== s ? a("el-button", {
                            staticStyle: {"margin-left": "15px"},
                            attrs: {type: "danger", size: "mini", plain: "", icon: "el-icon-delete"},
                            on: {
                                click: function (e) {
                                    return t.toAddDel(1, s, 1 === t.subForm.clock_cash_type ? "level_list" : "list")
                                }
                            }
                        }, [t._v(t._s(t.$t("action.delete")))]) : t._e(), t._v(" "), s === (1 === t.subForm.clock_cash_type ? t.subForm.level_list.length - 1 : t.subForm.list.length - 1) ? a("el-button", {
                            staticStyle: {"margin-left": "15px"},
                            attrs: {type: "primary", size: "mini", plain: "", icon: "el-icon-plus"},
                            on: {
                                click: function (e) {
                                    return t.toAddDel(2, s, 1 === t.subForm.clock_cash_type ? "level_list" : "list")
                                }
                            }
                        }, [t._v(t._s(t.$t("action.add")))]) : t._e()], 1)
                    }), 0)], 1) : t._e(), t._v(" "), t.routesItem.auth.addclockcashsetting && (t.routesItem.userInfo.is_admin && (t.routesItem.auth.reseller || t.routesItem.auth.salesman || t.routesItem.auth.channel) || !t.routesItem.userInfo.is_admin && (t.routesItem.auth.reseller && t.routesItem.auth.reseller_auth || t.routesItem.auth.salesman && t.routesItem.auth.salesman_auth || t.routesItem.auth.channel && t.routesItem.auth.channel_auth)) ? a("block", [a("lb-classify-title", {attrs: {title: "推广人员加钟返佣设置"}}), t._v(" "), a("el-form-item", {
                        attrs: {
                            label: "推广人员加钟返佣设置",
                            prop: "user"
                        }
                    }, t._l(t.subForm.addclock_balance, function (e, s) {
                        return a("div", {
                            directives: [{
                                name: "show",
                                rawName: "v-show",
                                value: t.routesItem.auth[t.userList[e.type].key] && (t.routesItem.userInfo.is_admin || !t.routesItem.userInfo.is_admin && 2 !== e.type && "partner_auth" !== t.userList[e.type].auth && t.routesItem.auth[t.userList[e.type].auth]),
                                expression: "\n              routesItem.auth[userList[item.type].key] &&\n              (routesItem.userInfo.is_admin ||\n                (!routesItem.userInfo.is_admin &&\n                  item.type !== 2 &&\n                  userList[item.type].auth !== 'partner_auth' &&\n                  routesItem.auth[userList[item.type].auth]))\n            "
                            }], key: s, staticClass: "flex-y-center", class: [{"mt-lg": s}]
                        }, [a("div", {staticStyle: {width: "130px"}}, [a("el-checkbox", {
                            model: {
                                value: e.status,
                                callback: function (a) {
                                    t.$set(e, "status", a)
                                },
                                expression: "item.status"
                            }
                        }, [t._v(t._s(t.userList[e.type].title))])], 1), t._v(" "), a("div", {staticClass: "mr-md"}, [t._v("在返佣比例上")]), t._v(" "), a("el-input", {
                            attrs: {placeholder: "请输入返佣比例"},
                            model: {
                                value: e.balance, callback: function (a) {
                                    t.$set(e, "balance", a)
                                }, expression: "item.balance"
                            }
                        }, [a("el-select", {
                            staticStyle: {width: "90px"},
                            attrs: {slot: "prepend", placeholder: "请选择"},
                            slot: "prepend",
                            model: {
                                value: e.add, callback: function (a) {
                                    t.$set(e, "add", a)
                                }, expression: "item.add"
                            }
                        }, [a("el-option", {
                            attrs: {
                                label: "增加",
                                value: 1
                            }
                        }), t._v(" "), a("el-option", {
                            attrs: {
                                label: "减少",
                                value: 0
                            }
                        })], 1), t._v(" "), a("template", {slot: "append"}, [t._v("%")])], 2), t._v(" "), a("lb-tool-tips", [t._v("设置0则表示加钟订单和主订单的返佣比例一致，不勾选则表示加钟订单不返佣\n              "), a("div", {staticClass: "mt-sm"}, [t._v("\n                设置增加X%，则表示在订单提成比例上增加x%的提成比例，就是加钟订单的返佣比例，减少X%为同理\n              ")])])], 1)
                    }), 0)], 1) : t._e(), t._v(" "), a("el-form-item", [a("lb-button", {
                        directives: [{
                            name: "preventReClick",
                            rawName: "v-preventReClick"
                        }], attrs: {type: "primary"}, on: {click: t.submitFormInfo}
                    }, [t._v(t._s(t.$t("action.submit")))])], 1)], 1)], 1)], 1)
                }, staticRenderFns: []
            };
        var b = a("VU/8")(v, p, !1, function (t) {
            a("duhp")
        }, "data-v-ab445a32", null);
        e.default = b.exports
    }, duhp: function (t, e) {
    }
});